let btn = document.querySelector('button')
let inps = document.querySelectorAll('input')
console.log(btn);
console.log(inps);
btn.onclick = () => {
    if (inps[0].value && inps[1].value) {
        axios.post('/api/login', { username: inps[0].value, password: inps[1].value }).then((res) => {
            console.log(res.data);
            alert(res.data.msg)
            if(res.data.code == 200){
                window.location.href = 'http://localhost:2020/index.html'
            }
        })
    }
    else{
        alert('用户名和密码不能为空')
    }
}